﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Discuz.Toolkit;
using Icst.Leaflike.Discuz;

namespace Icst.Leaflike.Web
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string userName = Request.Form["username"].Trim();
                string password = Request.Form["password"].Trim();
                User user = null;
                if (UserAccount.Login(userName, password, out user))
                {
                    Session.UserData().User = user;
                }
                Response.Write("<script language=\"javascript\">window.top.location.href='index.aspx';</script>");
            }
        }
    }
}
